import { request } from './request'

// 提交社情民意申请
export function submitCivils(data){
  return request({
    url:'/users/publicOpinions/submitPublicOpinions',
    method:'post',
    data:data
  })
}

// 获取我的社情民意列表
export function getMyList(data){
  return request({
    url:'/users/publicOpinions/list',
    method:'post',
    data:data
  })
}

// 获取需处理的联名列表
// 我的联名
export function mysignRequest(data){
  return request({
    url:'/users/publicOpinionSigners/list',
    data:data,
    method:'post'
  })
}

// 获取报送详情
export function civilDetail(data) {
  return request({
    url:`/users/publicOpinions/${data}`
  })
}

// 报送联名详情处理
export function consignDeal(data) {
  const {opinionsId,status} = data
  return request({
    url:`/users/publicOpinionSigners/change?opinionsId=${opinionsId}&status=${status}`,
    method:'put'
  })
}

// 获取公示报送
export function publicOpinions(data){
  return request({
    url:'/users/publicOpinions/getAllPublic',
    method:'post',
    data:data
  })
}

// 取消联名人未确人的报送
export function cancelConsign(data) {
  return request({
    url:`/users/publicOpinionSigners/deleteConsignOpinion/${data}`,
    method:'delete',
  })
}

// 取消已开始初审的报送
export function applyCancel(data) {
  return request({
    url:`/users/publicOpinions/applyCancel/${data}`,
    method:'put'
  })
}